package com.zm.xiaohashu.user.biz.rpc;

import com.zm.response.Response;
import com.zm.xiaohashu.oss.api.FileFeignApi;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

@Service
@Slf4j
public class OssRpcService {
    @Resource
    private FileFeignApi fileFeignApi;

    public String uploadFile(MultipartFile file) {
        Response<?> response = fileFeignApi.uploadFile(file);
        if (!response.isSuccess()) {
            return null;
        }
        return (String) response.getData();
    }
}
